#include<bits/stdc++.h>
#define pd(n) printf("%d", (n))
using namespace std;
int ans=0, mx_prime;
bool is_prime(int x)
{
    if (x < 2) return false;
    for (int i = 2; i <= x / i; i++)
        if (x % i == 0)
            return false;
    return true;
}
int main()
{
    int num = 2;
    while (ans <2019)
    {
        if (is_prime(num))
        {
            ans++; 
            mx_prime = num; 
            num++;
            continue;
        }
        num++;
    }
    pd(mx_prime);
    return 0;
}